import Vue from 'vue'
import Vuex from 'vuex'
import $axios from './axiosutil.js'
import router from "./routers";

//挂载Vuex
Vue.use(Vuex)

//创建VueX对象
const store = new Vuex.Store({
    //state中存放的就是全局共享的数据
    state: {

    },
    getters:{

    },
    mutations: {

    },
    actions: {
        //注册
        zhuce : async function(context,shangbo){
            let reult=await $axios.post("administration/business/createShangJia",shangbo);
            if(reult.data.code==401){
                alert(reult.data.message);
            }
            if(reult.data.code==200){
                alert(reult.data.message);
                router.push("login")
            }
            if(reult.data.code==500) {
                alert(reult.data.message)
            }
        },
    }
})

export default store